{include(header)}
<style>
.mtable{float:left;margin:10px;width:700px;border-collapse: collapse;clear:both;border:1px #ccc solid}
.mtable td{text-align:center;text-align:left;padding:5px 0px 5px 10px}
.mtable .xtit{border-bottom:1px #ccc dotted;font-size:14px;font-weight:bold}
.mtable .xcol1{float:left}
.mtable .xcol2{float:right;margin-right:10px}
.mtable .recont{float:left;width:650px}
.newsbox{float:left;width:360px;border:1px #ccc solid;border-radius:7px}
.newsbox li{float:left;width:100%;border-top:1px #ccc solid}
.newsbox .xtop{width:350px;margin:5px;border-top:0px;overflow:hidden}
.newsbox .xtop div{width:100%;text-align:center}
.newsbox .xtop .ximg{background:#efefef}
.newsbox .xtop img{max-width:350px;_zoom:expression(function(x){ if(x.width>350){x.width=350;}}(this));max-height:200px;_zoom:expression(function(x){ if(x.height>200){x.height=200;}}(this));}
.newsbox .xtop .xtit1{position:relative;height:14px;background:url(images/transparent.png);color:#fff;text-align:left;width:345px;padding:3px 0px 3px 5px;top:-20px}
.newsbox .xtit2{float:left;width:280px;margin:15px 0px 0px 5px}
.newsbox .ximg2{float:right;margin-right:5px}
.newsbox .ximg2 img{width:40px;height:50px}
.newsbox2{float:left;width:350px;border:1px #ccc solid;padding:5px;border-radius:7px;}
.newsbox2 li{float:left;width:350px;text-align:left;color:#888;padding:5px 0px 3px 0px}
.newsbox2 .xpic{background:#f8f8f8;text-align:center}
.newsbox2 .xtit3{font-weight:bold;font-size:14px;color:#000}
</style>
<div class="pMenu" id="id_pMenu">
	<input type="hidden" name="url_type" value="" id="id_url_type">
	<li style="font-weight:bold;display:none"><input type="hidden" name="url_site_id" value="{$admin_site['id']}" id="id_url_site_id"><span class="more1" onmouseover="kj.windiv({'id':'shop_site_windiv','fid':this,'src':'common.php?app=weixin&app_act=dialog.site&url_mode=1'});" id="id_site_id">站点：{if(empty($weixin_site["name"]))}选择{else}{$weixin_site["name"]}{/if}</span></li>
	<li onclick="kj.obj('#id_url_type').value='';admin.act('');">被添加自动回复</li>
	<li onclick="kj.obj('#id_url_type').value='1';admin.act('');">消息自动回复</li>
	<li class="sel">关键词自动回复</li>
	<li onclick="master_open({id:'add_act',title:'添加关键词',url:'{fun_get::url(array('app_act'=>'keywords.edit','id'=>0))}',w:800});" class="x_btn">添加</li>
	<li class = "x_btn"><a href="javascript:parent.thisjs.klkkdj_open('微信-关键词自动回复','app=service&app_act=help&key=help.weixin.message.keywords');" title="帮助"><img src="images/faq.gif"></a></li>
</div>
<div class="pMain" id="id_main">
	{foreach($arr_list as $item)}
	<table class='mtable'>
	<tr class="xtit">
		<td><span class='xcol1'>关键词：{$item['keywords_val']}</span><span class='xcol2'><a href="javascript:master_open({id:'add_act',title:'编辑关键词',url:'{fun_get::url(array('app_act'=>'keywords.edit','id'=>$item['keywords_id']))}',w:800});"><img src="images/b_edit.png"></a>&nbsp;&nbsp;<a href="javascript:admin.ajax_delete({$item['keywords_id']});"><img src="images/b_drop.png"></a></span></td>
	</tr>
	<tr>
		<td>
		<div style="float:left">回复：</div>
		<div class="recont">
		{if($item['message_type']=='image')}
			<img src="{$item['media_url']}" width="50px" height="70px"><br>{$item['media_name']}
		{else if($item['message_type']=='voice')}
			<img src="images/mp3.png" style="width:auto;height:auto"><br>{$message['media_name']}
		{else if($item['message_type']=='video')}
			<img src="images/video.png" style="width:auto;height:auto"><br>{$message['media_name']}
		{else if($item['message_type']=='news')}
			{if(count($item['news'])>1)}
				{set $ii=0}
				<div class="newsbox">
				{foreach($item['news'] as $new)}
					{if($ii==0)}
						<li class="xtop"><div class="ximg"><img src="{$new['pic']}"></div><div class="xtit1">{$new['title']}</div></li>
						{set $ii=1}
					{else}
						<li><div class="xtit2">{$new['title']}</div><div class="ximg2"><img src="{$new['pic']}"></div></li>
					{/if}
				{/foreach}
				</div>
			{else}
				{foreach($item['news'] as $new)}
					<div class="newsbox2">
						<li class="xtit3">{$new['title']}</li>
						<li>{$nowdate}</li>
						<li class="xpic"><img src="{$new['pic']}"></li>
						<li>{$new['desc']}</li>
					</div>
				{/foreach}
			{/if}
		{else}
			{$item['message_text']}
		{/if}
		</div></td></tr>
	</table>
	{/foreach}
</div>
<script>
//店铺选择回调函数
function site_callback(o) {
	if("id" in o) {
		kj.set("#id_url_site_id" , "value" , o.id);
		admin.refresh();
	}
}
kj.onload(function(){
	var arr = kj.obj(".newsbox .xtop");
	var h = 0;
	for(var i = 0 ; i < arr.length; i++) {
		arrdiv = kj.obj("div" , arr[i]);
		h = kj.h(arrdiv[0]);
		kj.set(arr[i],'style.height',h+'px');
	}
});
</script>
{include(footer)}